﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Data;
using CustomsSystem.BLL;
using CustomsSystem.Model;
using Maticsoft.Common;

namespace WEB.feetype
{
    public partial class Addfee : System.Web.UI.Page
    {
        Info_feeType FT = new Info_feeType();
        FeeTypeManage FM = new FeeTypeManage();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (FM.Exists(TextBox1.Text) == false)
            {
                FT.feeTypeNo = TextBox1.Text;
                FT.feeName = TextBox2.Text;
                if (rbn1.Checked == true)
                { FT.feeType = 0; }
                else FT.feeType = 1;
                FM.Add(FT);
                Response.Write("<Script>alert('增加费用类别成功!')</Script>");
                TextBox1.Text = string.Empty;
                TextBox2.Text = string.Empty;
            }
            else
            {
                Response.Write("<Script>alert('已有此编号，请重新输入!')</script>");
            }
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            Response.Redirect("Index_fee.aspx");
        }
    }
}